Integrand size = 21, antiderivative size = 89 \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=-\frac {11 a^3 x}{2}+\frac {5 a^3 \cos (c+d x)}{d}-\frac {a^3 \cos ^3(c+d x)}{3 d}+\frac {4 a^3 \cos (c+d x)}{d (1-\sin (c+d x))}+\frac {3 a^3 \cos (c+d x) \sin (c+d x)}{2 d} \]
-11/2*a^3*x+5*a^3*cos(d*x+c)/d-1/3*a^3*cos(d*x+c)^3/d+4*a^3*cos(d*x+c)/d/( 1-sin(d*x+c))+3/2*a^3*cos(d*x+c)*sin(d*x+c)/d
Time = 5.64 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.29 \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=\frac {(a+a \sin (c+d x))^3 \left (-66 (c+d x)+57 \cos (c+d x)-\cos (3 (c+d x))+\frac {96 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}+9 \sin (2 (c+d x))\right )}{12 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^6} \]
((a + a*Sin[c + d*x])^3*(-66*(c + d*x) + 57*Cos[c + d*x] - Cos[3*(c + d*x) ] + (96*Sin[(c + d*x)/2])/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2]) + 9*Sin[2* (c + d*x)]))/(12*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^6)
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.93, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3188, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) (a \sin (c+d x)+a)^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 (a \sin (c+d x)+a)^3dx\) |
\(\Big \downarrow \) 3188 |
\(\displaystyle a^2 \int \left (-a \sin ^3(c+d x)-3 a \sin ^2(c+d x)-4 a \sin (c+d x)-4 a+\frac {4 a}{1-\sin (c+d x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a^2 \left (-\frac {a \cos ^3(c+d x)}{3 d}+\frac {5 a \cos (c+d x)}{d}+\frac {3 a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {4 a \cos (c+d x)}{d (1-\sin (c+d x))}-\frac {11 a x}{2}\right )\) |
a^2*((-11*a*x)/2 + (5*a*Cos[c + d*x])/d - (a*Cos[c + d*x]^3)/(3*d) + (4*a* Cos[c + d*x])/(d*(1 - Sin[c + d*x])) + (3*a*Cos[c + d*x]*Sin[c + d*x])/(2* d))
3.1.31.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ ), x_Symbol] :> Simp[a^p Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m - p/2, 0])
Result contains complex when optimal does not.
Time = 5.00 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.10
method | result | size |
risch | \(-\frac {11 a^{3} x}{2}+\frac {19 a^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {19 a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {8 a^{3}}{d \left (-i+{\mathrm e}^{i \left (d x +c \right )}\right )}-\frac {a^{3} \cos \left (3 d x +3 c \right )}{12 d}+\frac {3 \sin \left (2 d x +2 c \right ) a^{3}}{4 d}\) | \(98\) |
derivativedivides | \(\frac {a^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+3 a^{3} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+3 a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+a^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(167\) |
default | \(\frac {a^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+3 a^{3} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+3 a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+a^{3} \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(167\) |
parts | \(\frac {a^{3} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {a^{3} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )}{d}+\frac {3 a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d}+\frac {3 a^{3} \left (\frac {\sin ^{5}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )}{d}\) | \(177\) |
-11/2*a^3*x+19/8*a^3/d*exp(I*(d*x+c))+19/8*a^3/d*exp(-I*(d*x+c))+8*a^3/d/( -I+exp(I*(d*x+c)))-1/12*a^3/d*cos(3*d*x+3*c)+3/4/d*sin(2*d*x+2*c)*a^3
Time = 0.31 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.73 \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=-\frac {2 \, a^{3} \cos \left (d x + c\right )^{4} - 7 \, a^{3} \cos \left (d x + c\right )^{3} + 33 \, a^{3} d x - 30 \, a^{3} \cos \left (d x + c\right )^{2} - 24 \, a^{3} + 3 \, {\left (11 \, a^{3} d x - 15 \, a^{3}\right )} \cos \left (d x + c\right ) - {\left (2 \, a^{3} \cos \left (d x + c\right )^{3} + 33 \, a^{3} d x + 9 \, a^{3} \cos \left (d x + c\right )^{2} - 21 \, a^{3} \cos \left (d x + c\right ) + 24 \, a^{3}\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d\right )}} \]
-1/6*(2*a^3*cos(d*x + c)^4 - 7*a^3*cos(d*x + c)^3 + 33*a^3*d*x - 30*a^3*co s(d*x + c)^2 - 24*a^3 + 3*(11*a^3*d*x - 15*a^3)*cos(d*x + c) - (2*a^3*cos( d*x + c)^3 + 33*a^3*d*x + 9*a^3*cos(d*x + c)^2 - 21*a^3*cos(d*x + c) + 24* a^3)*sin(d*x + c))/(d*cos(d*x + c) - d*sin(d*x + c) + d)
\[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=a^{3} \left (\int 3 \sin {\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int 3 \sin ^{2}{\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \sin ^{3}{\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )}\, dx\right ) \]
a**3*(Integral(3*sin(c + d*x)*tan(c + d*x)**2, x) + Integral(3*sin(c + d*x )**2*tan(c + d*x)**2, x) + Integral(sin(c + d*x)**3*tan(c + d*x)**2, x) + Integral(tan(c + d*x)**2, x))
Time = 0.28 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.31 \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=-\frac {2 \, {\left (\cos \left (d x + c\right )^{3} - \frac {3}{\cos \left (d x + c\right )} - 6 \, \cos \left (d x + c\right )\right )} a^{3} + 9 \, {\left (3 \, d x + 3 \, c - \frac {\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} a^{3} + 6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{3} - 18 \, a^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{6 \, d} \]
-1/6*(2*(cos(d*x + c)^3 - 3/cos(d*x + c) - 6*cos(d*x + c))*a^3 + 9*(3*d*x + 3*c - tan(d*x + c)/(tan(d*x + c)^2 + 1) - 2*tan(d*x + c))*a^3 + 6*(d*x + c - tan(d*x + c))*a^3 - 18*a^3*(1/cos(d*x + c) + cos(d*x + c)))/d
Timed out. \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=\text {Timed out} \]
Time = 9.79 (sec) , antiderivative size = 288, normalized size of antiderivative = 3.24 \[ \int (a+a \sin (c+d x))^3 \tan ^2(c+d x) \, dx=-\frac {11\,a^3\,x}{2}-\frac {\frac {11\,a^3\,\left (c+d\,x\right )}{2}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {11\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (33\,c+33\,d\,x-38\right )}{6}\right )-\frac {a^3\,\left (33\,c+33\,d\,x-104\right )}{6}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {11\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (33\,c+33\,d\,x-66\right )}{6}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {33\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (99\,c+99\,d\,x-66\right )}{6}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {33\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (99\,c+99\,d\,x-120\right )}{6}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {33\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (99\,c+99\,d\,x-192\right )}{6}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {33\,a^3\,\left (c+d\,x\right )}{2}-\frac {a^3\,\left (99\,c+99\,d\,x-246\right )}{6}\right )}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3} \]
- (11*a^3*x)/2 - ((11*a^3*(c + d*x))/2 - tan(c/2 + (d*x)/2)*((11*a^3*(c + d*x))/2 - (a^3*(33*c + 33*d*x - 38))/6) - (a^3*(33*c + 33*d*x - 104))/6 + tan(c/2 + (d*x)/2)^6*((11*a^3*(c + d*x))/2 - (a^3*(33*c + 33*d*x - 66))/6) - tan(c/2 + (d*x)/2)^5*((33*a^3*(c + d*x))/2 - (a^3*(99*c + 99*d*x - 66)) /6) - tan(c/2 + (d*x)/2)^3*((33*a^3*(c + d*x))/2 - (a^3*(99*c + 99*d*x - 1 20))/6) + tan(c/2 + (d*x)/2)^4*((33*a^3*(c + d*x))/2 - (a^3*(99*c + 99*d*x - 192))/6) + tan(c/2 + (d*x)/2)^2*((33*a^3*(c + d*x))/2 - (a^3*(99*c + 99 *d*x - 246))/6))/(d*(tan(c/2 + (d*x)/2) - 1)*(tan(c/2 + (d*x)/2)^2 + 1)^3)